<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<!--
        This program is free software; you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
        the Free Software Foundation; either version 2 of the License, or
        (at your option) any later version.
        
        This program is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        GNU General Public License for more details.
        
        You should have received a copy of the GNU General Public License
        along with this program; if not, write to the Free Software
        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
        MA 02110-1301, USA.
-->

<html>
	<head>
		<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
		<meta HTTP-EQUIV="Expires" CONTENT="-1">
		<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
		<link type="text/css" href="../../css/jquery-ui/current/jquery-ui.css" rel="stylesheet" />
		<link type="text/css" href="../../css/iframe.css" rel="stylesheet" />
		<script type="text/javascript" src="../../js/jquery.js"></script>
		<script type="text/javascript" src="../../js/jquery-ui.js"></script>
		<script type="text/javascript" src="../../js/jquery.xslt.js"></script>
		<script type="text/javascript" src="../../js/jquery.form.js"></script>
		<script type="text/javascript" src="../../js/iframe.js"></script>
	</head>
	<body style="font-size:12px;">
		<form action="../../../../bin/kernel.py?func=addTransactionType" method="post" id="transactiontype">
			<table>
				<tr>
					<td>Transaction Code:</td>
					<td><div id="autoTransactionIdDiv"></div></td>
				</tr>
				<tr>
					<td>Transaction Type:</td>
					<td><input style="width:330px" type="text" name="type" id="type" /></td>
				</tr>
				<tr>
					<td>Transaction Formula:</td>
					<td>
						<select style="width:336px" name="formula" id="formula">
							<option value="0">minus</option>
							<option value="1">plus</option>
						</select>
					</td>
				</tr>
				<tr>
					<td colspan="2" align="right"><button type="submit">Add transaction type</button></td>
				</tr>
			</table>
		</form>
		<script language="javascript">
			function updateATI() {
				$.ajax({
					type: "GET",
					url: "../../../../bin/kernel.py?func=getATI",
					success: function(msg){
						$('#autoTransactionIdDiv').text(msg);
					}
				});
			}
			
			$(function() {
				$("#transactiontype").ajaxForm(function() {
					alert("Added!!!");
					updateATI();
					$('#transactiontype').resetForm();
				});
			
				updateATI();
			});			
		</script>
	</body>
</html>
